package com.hx.chain;

/**
 * @author Huathy
 * @date 2021-09-23 21:57
 * @description
 */
public class App {

    static IRequestProcessor requestProcessor;

    public void setUp(){
        PrintProcessor printProcessor = new PrintProcessor();
        printProcessor.start();
        PreProcessor preProcessor = new PreProcessor(printProcessor);
        preProcessor.start();
        requestProcessor = new SaveProcessor(preProcessor);
        ((SaveProcessor)requestProcessor).start();
    }

    public static void main(String[] args) {
        App app = new App();
        app.setUp();
        Request request = new Request();
        request.setName("Huathy");
        requestProcessor.process(request);
    }
}
